****FluVaxPoliticsSurvey
*This survey was implemented by Dynata from 8/27/22 to 8/29/22

cd  " "

use "FluVaxPolitics.dta"  

**Sex
*Q120 What sex were you assigned at birth, on your original birth certificate?
*Male  (1) 
*Female  (2) 
tab Q120
codebook Q120        //1 male;2 female//
gen sex= Q120-1
tab sex
label define sex 0 "Male" 1 "Female"
label values sex sex
tab sex,m


**Education
*Q6 What is the highest level of education you have completed?
tab Q6
gen edu=Q6
tab edu


**Income
*Q7 What is your annual household income (before taxes)?
tab Q7
gen income=Q7
tab income

**Age
*Q8 What is your age in years?
tab Q8
gen age=Q8
tab age,m


**Race
*Q14 If you had to choose, what would you say is your race? Check all that apply. 
*White/Caucasian  (1) 
*Black/African American  (2) 
*American Indian or Alaska Native  (3) 
*Asian/Asian-American  (4) 
*Native Hawaiian or Pacific Islander  (5) 
*Hispanic or Latino  (6) 
*Other (please specify)  (7)
tab Q14

gen race3=.
replace race3=0 if Q14=="1"
replace race3=1 if Q14=="2"
replace race3=2 if Q14=="1,2"
replace race3=2 if Q14=="1,2,3"
replace race3=2 if Q14=="1,2,3,4"
replace race3=2 if Q14=="1,2,3,4,5,6,7"
replace race3=2 if Q14=="1,2,3,6"
replace race3=2 if Q14=="1,2,6"
replace race3=2 if Q14=="1,3"
replace race3=2 if Q14=="1,3,6"
replace race3=2 if Q14=="1,3,7"
replace race3=2 if Q14=="1,4"
replace race3=2 if Q14=="1,5"
replace race3=2 if Q14=="1,6"
replace race3=2 if Q14=="1,7"
replace race3=2 if Q14=="2,3"
replace race3=2 if Q14=="2,4,5"
replace race3=2 if Q14=="2,6"
replace race3=2 if Q14=="2,7"
replace race3=2 if Q14=="3"
replace race3=2 if Q14=="3,6"
replace race3=2 if Q14=="4"
replace race3=2 if Q14=="4,5"
replace race3=2 if Q14=="4,6"
replace race3=2 if Q14=="5"
replace race3=2 if Q14=="6"
replace race3=2 if Q14=="7"
tab race3
label define race3 0 "Non-Hispanic White" 1 "Non-Hispanic Black" 2 "All other"
label values race3 race3
tab race3


 
**Party
*Q9 Generally speaking, do you think of yourself as a Republican, Democrat, Independent, or what?
*Republican  (1) 
*Democrat  (2) 
*Independent  (3) 
*Other party (specify)  (4)
tab Q9

*Q10 Would you call yourself a strong Democrat or not a very strong Democrat?
*Strong  (1) 
*Not very strong  (2)
tab Q10

*Q11 Would you call yourself a strong Republican or not a very strong Republican?
*Strong  (1) 
*Not very strong  (2) 
tab Q11

*Q12 Do you think of yourself as closer to the Republican Party or the Democratic Party?
*Closer to Republican  (1) 
*Neither  (2) 
*Closer to Democratic  (3) 
tab Q12

gen party7=.
replace party7=1 if Q10==1             //strong democrat//
replace party7=2 if Q10==2            //not very strong democrat//
replace party7=3 if Q12==3           //3=indepedent closer to democratic//
replace party7=4 if Q12==2          //2=indepedent neither De or Re
replace party7=5 if Q12==1         //1=indepedent Closer to Republican // 
replace party7=6 if Q11==2        //Not very strong  republican//
replace party7=7 if Q11==1       //strong democrat// 
tab party7,m

gen party3=.
replace party3=0 if party7==1| party7==2 | party7==3
replace party3=1 if party7==4
replace party3=2 if party7==5| party7==6 | party7==7
tab party3
label define party3 0 "Democrat" 1 "Independent" 2 "Republican"
label values party3 party3
tab party3,m

tab Q9,m       //Republican  (1) ; Democrat  (2) ; Independent  (3) ;Other party (specify) (4)//
gen party4=. 
replace party4=party3
replace party4=3 if party4==.
tab party4,m 

gen party2=.
replace party2=0 if party3==0
replace party2=1 if party3==2
tab party2
label define party2 0 "Democrat" 1 "Republican"
label values party2 party2
tab party2,m                                



**Political knowledge
*Q112 What job or political office does Mitch McConnell now hold?
*House Minority Leader  (1) 
*Senate Minority Leader  (2) 
*Treasury Secretary  (3) 
*Chairman of the Federal Reserve  (4) 
*Don't know/Unsure  (5)
tab Q112
gen pk1=.
replace pk1=1 if Q112==2
replace pk1=0 if Q112==1 | Q112==3 | Q112==4 | Q112==5
tab pk1


*Q113 What job or political office does Antony Blinken now hold?
*National Security Advisor  (1) 
*President Pro Tempore of the Senate  (2) 
*Justice on the Supreme Court  (3) 
*Secretary of State  (4) 
*Don't know/Unsure  (5) 
tab Q113
gen pk2=.
replace pk2=1 if Q113==4
replace pk2=0 if Q113==1 | Q113==2 | Q113==3 | Q113==5
tab pk2


*Q114 In the U.S. Senate a presidential veto can be overridden by a….
*Majority vote in both chambers of Congress  (1) 
*2/3 vote in both chambers of Congress  (2) 
*3/4 vote in both chambers of Congress  (3) 
*None of the above  (4) 
tab Q114
gen pk3=.
replace pk3=1 if Q114==2
replace pk3=0 if Q114==1 | Q114==3 | Q114==4
tab pk3


*Q115 Which political party controls the U.S. House of Representatives?
*Republican Party  (1) 
*Democratic Party  (2) 
*Don't know  (3) 
tab Q115
gen pk4=.
replace pk4=1 if Q115==2
replace pk4=0 if Q115==1 | Q115==3
tab pk4

gen pkavg=(pk1+pk2+pk3+pk4)/4
tab pkavg




****Experimental Condition
tab Group,m
codebook Group

gen condition=.
replace condition=0 if Group=="Control"
replace condition=1 if Group=="China"
replace condition=2 if Group=="Japan"

tab condition
label define condition 0 "Control (US Alone)" 1 "Collab w/ China" 2 "Collab w/ Japan"
label values condition condition
tab condition


****DV Questions
**Control
*Q75 In some years, the U.S. collaborates with other countries to develop the flu vaccine. If the FDA approved flu shot was developed without collaboration (developed in the U.S. alone), would you get the vaccine this year?
*No  (1) 
*Yes  (2) 
*Don't know  (3)
tab Q75

**China Treatment
*Q76 In some years, the U.S. collaborates with other countries to develop the flu vaccine. If the FDA approved flu shot was developed through a US-China collaboration, would you get the vaccine this year?
*No  (1) 
*Yes  (2) 
*Don't know  (3) 
tab Q76

**Japan Treatment
*Q77 In some years, the U.S. collaborates with other countries to develop the flu vaccine. If the FDA approved flu shot was developed through a US-Japan collaboration, would you get the vaccine this year?
*No  (1) 
*Yes  (2) 
*Don't know  (3) 
tab Q77


**Merge into 1 DV
egen getvacc= rowmax(Q75 Q76 Q77)
tab getvacc
label define getvacc  1 "No" 2 "Yes" 3 "Don't Know"
label values getvacc getvacc
tab getvacc,m



*make dichotomous (drop don't knows), and change to 0=no, 1=yes
gen getvaccdi=getvacc-1
replace getvaccdi=. if getvacc==3
tab getvaccdi,m            


*make into a 3 pt scale with don't knows in the middle
gen getvaccord=.
replace getvaccord=0 if getvacc==1
replace getvaccord=1 if getvacc==3
replace getvaccord=2 if getvacc==2
label define getvaccord  0 "No" 1 "Don't Know" 2 "Yes"
label values getvaccord getvaccord
tab getvaccord,m
 

*anohter dichotomous variable:Yes=1;otherwise=0
gen getvaccord2=.
replace getvaccord2=0 if getvaccord==0|getvaccord==1
replace getvaccord2=1 if getvaccord==2
tab getvaccord2,m



******Analysis and results
***Descriptive statistics
tab condition,m 
codebook condition       //0=US alone;1=US-China;2=US-Japan//
tab getvaccord,m        //0(No);1(DNK);2(Yes)//
tab getvaccdi,m        //dichotomous variable;drop "Don't know"//
tab getvaccord2,m     //1=yes,0=otherwise// 


***table1. Respondents’ willingness to get the vaccine-all sample for H1
*binary variable：getvaccord2
*without partisanship
tab getvaccord2 if condition==0
tab getvaccord2 if condition==1
tab getvaccord2 if condition==2

prtest getvaccord2 if(condition==0 | condition==1), by(condition)        
prtest getvaccord2 if(condition==0 | condition==2), by(condition) 
  
logit getvaccord2 i.condition age i.sex edu income i.race3 i.party4 pkavg,robust
 
***Predicted Probabilities for Table 1
margins i.condition,vsquish
 
***note:US-China collaboration is lower than US-Japan collaboration
prtest getvaccord2 if(condition==1 | condition==2), by(condition)       


***table 2. with partisanship & interaction  
*Dem
tab party2,m
codebook party2               //0=democrat;1=republican//
tab getvaccord2 condition if(party2==0), col
prtest getvaccord2 if(condition==0 & party2==0 | condition==1 & party2==0), by(condition)
prtest getvaccord2 if(condition==0 & party2==0 | condition==2 & party2==0), by(condition)
*Rep
tab getvaccord2 condition if(party2==1), col
prtest getvaccord2 if(condition==0 & party2==1 | condition==1 & party2==1), by(condition)
prtest getvaccord2 if(condition==0 & party2==1 | condition==2 & party2==1), by(condition)

logit  getvaccord2  i.condition##i.party2 age i.sex edu income i.race3 pkavg,robust
*Predicted Probabilities
margins i.condition, at(party2=(0 1)) vsquish




***table 3  
*The omitted category in the multinomial logit models is “NO”
eststo clear
eststo:mlogit getvaccord i.condition age i.sex edu income i.race3 i.party4 pkavg, baseoutcome(0) robust 
estimates store m1, title(Model1)
eststo:mlogit getvaccord i.condition##i.party2 age i.sex edu income i.race3 pkavg ,baseoutcome(0) robust
estimates store m2, title(Model2)
estout m1 m2 ,cells(b(star fmt(3)) se(par fmt(3))) ///
legend label varlabels(_cons Constant) ///
stats(N aic bic, fmt(0 3 3) label(Observations AIC BIC))


***figure1
eststo clear
mlogit getvaccord i.condition##i.party2 age i.sex edu income i.race3 pkavg, baseoutcome(0) robust
margins ,  dydx(i.condition) at(party2=(0 1))  predict(outcome(2))  
marginsplot,  scheme(s1mono)     ///
xlab(0 " " 1 " " 2 "Collaborate with China " 3 "Collaborate with Japan" 4 " ",) ///
title("") yline(0,lpattern(dot))      ///
xtitle("Treatment conditions", margin(medium))     ///
ytitle("Effect on Probability of Getting Vaccine", margin(medium)) ///
recast(scatter) by(party2) 
*adjust figure1 in graph editor
 
 
 
**************************************
*Analyses for Supplemental Materials**
**************************************

***Sample information
tab sex,m 
tab age,m
sum age
tab edu,m
sum edu,detail
tab income,m
sum income,detail
tab race3 ,m 
tab pkavg,m
sum pkavg

***Descriptive statistics
tab condition,m
codebook condition
tab getvaccord,m   // 0 "No" 1 "Don't Know" 2 "Yes"//
****vaccination willingness
tab getvaccord if condition==0,m
tab getvaccord if condition==1,m
tab getvaccord if condition==2,m

***partisanship and vaccination willingness
tab party4,m     //0 "Democrat" 1 "Independent" 2 "Republican" 3"other party"//

tab getvaccord party4,col     
tab getvaccord party4 if condition==0,col 
tab getvaccord party4 if condition==1,col 
tab getvaccord party4 if condition==2,col 


***partisanship
tab	getvaccord2 party4 if condition==0,col
tab	getvaccord2 party4 if condition==1,col
tab	getvaccord2 party4 if condition==2,col
tab	getvaccord2 party4 if condition==2,m
tab	getvaccord2 party4 if condition==0,m,col
tab	getvaccord2 party4 if condition==1,m
tab	getvaccord2 party4 if condition==2,m

 
 ***table1-2 continuous variable:getvaccord
tab getvaccord,m
codebook getvaccord          //0=no;1=DNK;2=Yes//
tab getvaccord condition, col
sum getvaccord if condition==0
sum getvaccord if condition==1
sum getvaccord if condition==2


ttest getvaccord if(condition==0 | condition==1), by(condition)
ttest getvaccord if(condition==0 | condition==2), by(condition)

reg getvaccord i.condition age i.sex edu income i.race3 i.party4 pkavg,robust 
*Predicted Probabilities
margins i.condition 


***table 2-2 with partisanship interaction 
*Dem
tab getvaccord condition if(party2==0), col
sum getvaccord if condition==0&party2==0
sum getvaccord if condition==1&party2==0
sum getvaccord if condition==2&party2==0
ttest getvaccord if(condition==0 & party2==0 | condition==1 & party2==0), by(condition)
ttest getvaccord if(condition==0 & party2==0 | condition==2 & party2==0), by(condition)

*Rep
tab getvaccord condition if(party2==1), col
sum getvaccord if condition==0&party2==1
sum getvaccord if condition==1&party2==1
sum getvaccord if condition==2&party2==1
ttest getvaccord if(condition==0 & party2==1 | condition==1 & party2==1), by(condition)
ttest getvaccord if(condition==0 & party2==1 | condition==2 & party2==1), by(condition)

tab getvaccord,m


reg getvaccord i.condition##i.party2 age i.sex edu income i.race3 pkavg,robust
*Predicted Probabilities
margins i.condition, at(party2=(0 1)) vsquish


***table3-1
tab getvaccdi,m
eststo clear
eststo:logit getvaccdi i.condition age i.sex edu income i.race3 i.party4 pkavg,robust 
estimates store m1, title(Model1)
eststo:logit  getvaccdi i.condition##i.party2 age i.sex edu income i.race3 pkavg,robust
estimates store m2, title(Model2)
estout m1 m2 ,cells(b(star fmt(3)) se(par fmt(3))) ///
legend label varlabels(_cons Constant) ///
stats(N aic bic, fmt(0 3 3) label(Observations AIC BIC))


***table3-2 
eststo clear
eststo:ologit getvaccord i.condition age i.sex edu income i.race3 i.party4 pkavg,robust 
estimates store m1, title(Model1)
eststo:ologit  getvaccord i.condition##i.party2 age i.sex edu income i.race3 pkavg,robust
estimates store m2, title(Model2)
estout m1 m2 ,cells(b(star fmt(3)) se(par fmt(3))) ///
legend label varlabels(_cons Constant) ///
stats(N aic bic, fmt(0 3 3) label(Observations AIC BIC))


***table3-3
tab getvaccord2,m
eststo clear
eststo:logit getvaccord2 i.condition age i.sex edu income i.race3 i.party4 pkavg,robust 
estimates store m1, title(Model1)
eststo:logit  getvaccord2 i.condition##i.party2 age i.sex edu income i.race3 pkavg,robust
estimates store m2, title(Model2)
estout m1 m2 ,cells(b(star fmt(3)) se(par fmt(3))) ///
legend label varlabels(_cons Constant) ///
stats(N aic bic, fmt(0 3 3) label(Observations AIC BIC))

***figure2
eststo clear
logit  getvaccord2 i.condition##i.party2 age i.sex edu income i.race3 pkavg,robust
margins ,  dydx(i.condition) at(party2=(0 1))   
marginsplot,  scheme(s1mono)     ///
xlab(0 " " 1 " " 2 "Collaborate with China " 3 "Collaborate with Japan" 4 " ",) ///
title("") yline(0,lpattern(dot))      ///
xtitle("Treatment conditions", margin(medium))     ///
ytitle("Effect on Probability of Getting Vaccine", margin(medium)) ///
recast(scatter) by(party2) 
*adjust figure1 in graph editor


